package com.study.lxy.springcloud.uclient.configurer;

import com.study.lxy.springcloud.common.handler.GlobleExceptionHandler;
import com.study.lxy.springcloud.uclient.interceptor.LogInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Autowired
    private LogInterceptor logInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
       //registry.addInterceptor(logInterceptor).addPathPatterns("/**");
    }

    @Bean
    public GlobleExceptionHandler globleExceptionHandler(){
        return new GlobleExceptionHandler();
    }
}
